Climate Change: Day 9

date: September 23, 2014

Last Time

Exam 1, Grade distribution and summary statistics

Exam1 = read.table("http://myweb.fsu.edu/jelsner/Exam1.txt", 
                   header = TRUE)
library(ggplot2)
ggplot(Exam1, aes(factor(Score))) + 
  geom_histogram() +
  xlab("Exam Score") +
  ylab("Number of Students")

plot of chunk unnamed-chunk-1

round(mean(Exam1$Score), 1)
## [1] 24.6
round(median(Exam1$Score), 0)
## [1] 24
round(sd(Exam1$Score), 2)
## [1] 3.38

Today

Tropical vs extra-tropical cyclones and the jet stream:

Tropical Cyclone Forecast Models

What’s the difference? latent heat release vs temperature difference, what causes the jet stream? How is it changing? Arctic amplification, more extremely hot days.

alt text alt text

Understanding the Jet Stream

Is It Getting Hotter Here?

First, get your data into R. The first line of code sets the location of the data as a string of characters (letters, slashes, etc). The second line of code inputs the data as a data frame. The argument header = TRUE lets R know that the dataset has a top row that identifies the columns by name (header record).

L = 'http://myweb.fsu.edu/jelsner/data/TLHT.txt'
df = read.table(L, header = TRUE)

Check that the data are available by selecting the df object under the Environment tab.

Next load the functions that make it easy to manipulate the data and to make a graph.

library(ggplot2)
library(dplyr)

Arrange the data. To make a new data frame (Annual) take the data frame (df) then (%>%) group by year then average the daily high temperatures.

Annual = df %>% 
  group_by(Year) %>%
  summarize(Avg = mean(Tmax))

Make the graph. Use the ggplot() to graph the data in the Annual data frame.

ggplot(Annual, aes(x = Year, y = Avg)) +
  geom_point() + 
  geom_line() +
  geom_smooth(method = lm, size = 3) +
  ylab("Annual Average Temperature in Tallahassee (F)")

plot of chunk unnamed-chunk-5

Quantify the trend.

trModel = lm(Avg ~ Year, data = Annual)
coef(trModel)[2]
##    Year 
## 0.02687

Are There Now More Extremely Hot Days?

Here we define a hot day as one in which the high temperatures reaches 100F.

df %>%
  group_by(Year) %>%
  summarise(N100 = sum(Tmax >= 100)) %>%
ggplot(., aes(x = Year, y = N100)) +
  geom_bar(stat = "identity") +
  ylab("Number of days in Tallahassee at or exceeding 100F")

plot of chunk unnamed-chunk-7

Make it prettier.

df %>%
  group_by(Year) %>%
  summarise(N100 = sum(Tmax >= 100)) %>%  
ggplot(., aes(x = Year, y = N100, fill = N100)) +
  geom_bar(stat = "identity") +
  theme_bw() +
  scale_fill_continuous(low = 'orange', high = 'red') +
  geom_text(aes(label = N100), vjust = 1.5, size = 3) +
  ylab("Number of days in Tallahassee at or exceeding 100F") +
  scale_x_continuous(breaks = seq(1950, 2013, 10)) +
  xlab("") +
  theme(axis.text.x  = element_text(size = 11), 
        legend.position = "none")

plot of chunk unnamed-chunk-8

Lede: The hots are getting hotter.

More Heat